﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SRD.Model.SRD.DTO;
using SRD.Model.SRD.DAO;
namespace SRD.Model.SRD.BO
{   
    public class CargoBO
    {
        private CargoDAO dao;

        public CARGO findById(CARGO cargo)
        {
            return new CargoDAO().findByID(cargo);
        }

        public IQueryable findAll()
        {
            return new CargoDAO().findAll();
        }

        public IQueryable findByName(String nomeCargo)
        {
            return new CargoDAO().findByName(nomeCargo);
        }

        public IQueryable findCargoByEmpresaId(Int32 empresaId)
        {
            return new CargoDAO().findCargoByEmpresaId(empresaId);
        }

        public String save(CARGO cargo)
        {
            dao = new CargoDAO();
            return dao.insert(cargo);
        }

        public String update(CARGO cargo)
        {
            dao = new CargoDAO();
            return dao.update(cargo);
        }
        public String delete(CARGO cargo)
        {
            dao = new CargoDAO();
            return dao.delete(cargo);
        }
    }    
}
